package com.chuangke.sinotrukbudget.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.chuangke.core.http.HttpResult;
import com.chuangke.sinotrukbudget.service.BudgetAdminService;

/**
 * @author chuangke
 * @date 2022-10-20
 */
@RestController
@RequestMapping("budget/admin")
public class BudgetAdminController {

	@Autowired
	private BudgetAdminService budgetAdminService;

	@PreAuthorize("hasAuthority('login:action')")
	@GetMapping(value = "/deitdept")
	public HttpResult deitDept() {
		return HttpResult.ok(budgetAdminService.findUserEditDeptDetialData());
	}

	@PreAuthorize("hasAuthority('login:action')")
	@GetMapping(value = "/auditdept")
	public HttpResult auditDept() {
		return HttpResult.ok(budgetAdminService.findUserAuditDeptTreeData());
	}

	@PreAuthorize("hasAuthority('login:action')")
	@GetMapping(value = "/datadept")
	public HttpResult dataDept() {
		return HttpResult.ok(budgetAdminService.findUserAuditDeptDetailData());
	}

}
